<extend name="public:base" />

<block name="left">
	<div class="mark_bar cl">
		<a href="{:url('uc/index/index')}" class="goback fl"><i class="iconfont">&#xe600;</i></a>
		<p>安全中心</p>
	</div>
</block>

<block name="main">
	<div class="content">

		<div class="center_link_list">
			<ul>
				<if condition="$Think.session.user_auth.user_type eq 2 and $st.account_status eq 1">
					<li>
						<a href="javascript:movetop('company_info');">
							<span>企业信息</span>
							<i class="iconfont arrow_r">&#xe611;</i>
							<i class="des fr small red">查看</i>
							<div class="cl"></div>
						</a>
					</li>
				</if>
				<!--<li>
					<a <if condition="$st.account_status eq 1">href="javascript:void(0);"<else/>href="{:url('uc/index/account')}"</if>>
					<span>实名认证</span>
					<i class="iconfont arrow_r">&#xe611;</i>
					<if condition="$st.account_status eq 1">
						<i class="des fr small a999">已认证</i>
						<else/>
						<i class="des fr small red">未认证</i>
					</if>
					<div class="cl"></div>
					</a>
				</li>-->
				<li>
					<if condition="$st.account_status eq 1">
						<form action="{:url('uc/safe/pay_pass')}" method="post">
							<input type="hidden" name="type" value="2"/>
							<span>交易密码</span>
							<i class="iconfont arrow_r">&#xe611;</i>
							<input type="submit" class="submit_btn" value="修改"/>
							<div class="cl"></div>
						</form>
						<else/>
						<a href="{:url('uc/index/account')}">
							<span>交易密码</span>
							<i class="iconfont arrow_r">&#xe611;</i>
							<i class="des fr small red">未设置</i>
							<div class="cl"></div>
						</a>
					</if>
				</li>
				<!--
				<if condition="session('user_auth.user_type') eq 1">
					<li>
						<if condition="$st.account_status eq 1">
							<form action="{:url('uc/safe/change_phone')}" method="post">
								<span>手机验证</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small a999">手机尾号({$Think.session.user_auth.phone|substr=###,-4,4})</i>
								<input type="submit" class="submit_btn" value="更新"/>
								<div class="cl"></div>
							</form>
							<else/>
							<a href="{:url('uc/index/account')}">
								<span>手机验证</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small red">未设置</i>
								<div class="cl"></div>
							</a>
						</if>
					</li>
				</if>
				-->
				<li>
					<if condition="$st.account_status eq 1">
						<a <if condition="$st.has_bank_card eq 0">href="{:url('uc/bank/bind_bankcard')}"<else/>href="{:url('uc/bank/index')}"</if>>
						<span>银行卡信息</span>
						<i class="iconfont arrow_r">&#xe611;</i>
						<if condition="$st.has_bank_card eq 0">
							<i class="des fr small red">绑卡</i>
							<else/>
							<i class="des fr small a999">查看</i>
						</if>
						<div class="cl"></div>
						</a>
						<else/>
						<a href="{:url('uc/index/account')}">
							<span>银行卡信息</span>
							<i class="iconfont arrow_r">&#xe611;</i>
							<i class="des fr small red">未设置</i>
							<div class="cl"></div>
						</a>
					</if>
				</li>
			</ul>
		</div>
		<if condition="$st.account_status eq 1">
		<div class="center_link_list">
			<ul>
				<if condition="$Think.session.user_auth.type eq 1">
					<li>
						<if condition="$st.auto_recharge_status eq 1">
							<form action="{:url('uc/safe/cancel_auth')}" method="post" class="cancelAuth" data-text="您确定要取消充值授权吗？">
								<input type="hidden" name="auth_type" value="auto_recharge_status" />
								<span>自动充值授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small a999">取消</i>
								<input type="submit" class="submit_btn" value="取消"/>
								<div class="cl"></div>
							</form>
							<else/>
							<form action="{:url('uc/safe/auth')}" method="post">
								<input type="hidden" name="auth_type" value="auto_recharge_status" />
								<input type="hidden" name="auth_value" value="{$st.auto_recharge_status}">
								<span>自动充值授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small af60">开启</i>
								<input type="submit" class="submit_btn" value="开启"/>
							</form>
						</if>
					</li>
					<li>
						<if condition="$st.auto_repayment_status eq 1">
							<form action="{:url('uc/safe/cancel_auth')}" method="post" class="cancelAuth" data-text="您确定要取消还款授权吗？">
								<input type="hidden" name="auth_type" value="auto_repayment_status" />
								<span>自动还款授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small af60">取消</i>
								<input type="submit" class="submit_btn" value="取消还款授权"/>
							</form>
							<else/>
							<form action="{:url('uc/safe/auth')}" method="post">
								<input type="hidden" name="auth_type" value="auto_repayment_status" />
								<input type="hidden" name="auth_value" value="{$st.auto_repayment_status}">
								<span>自动还款授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small af60">开启</i>
								<input type="submit" class="submit_btn" value="开启"/>
							</form>
						</if>
					</li>
					<li>
						<if condition="$st.auto_withdraw_status eq 1">
							<form action="{:url('uc/safe/cancel_auth')}" method="post" class="cancelAuth" data-text="您确定要取消提现授权吗？">
								<input type="hidden" name="auth_type" value="auto_withdraw_status" />
								<span>自动提现授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small af60">取消</i>
								<input type="submit" class="submit_btn" value="取消"/>
							</form>
							<else/>
							<form action="{:url('uc/safe/auth')}" method="post">
								<input type="hidden" name="auth_type" value="auto_withdraw_status" />
								<input type="hidden" name="auth_value" value="{$st.auto_withdraw_status}">
								<span>自动提现授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small af60">开启</i>
								<input type="submit" class="submit_btn" value="开启"/>
							</form>
						</if>
					</li>
					<else/>
					<li>
						<if condition="$st.auto_invest_status eq 1">
							<form action="{:url('uc/safe/cancel_auth')}" method="post" class="cancelAuth" data-text="您确定要取消投标授权吗？">
								<span class="fl">自动投标授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small a999">取消</i>
								<input type="hidden" name="auth_type" value="auto_invest_status" />
								<input type="submit" class="submit_btn" value="取消"/>
							</form>
							<else/>
							<form action="{:url('uc/safe/auth')}" method="post">
								<input type="hidden" name="auth_type" value="auto_invest_status" />
								<input type="hidden" name="auth_value" value="{$st.auto_invest_status}">
								<span>自动投标授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small af60">开启</i>
								<input type="submit" class="submit_btn" value="开启"/>
							</form>
						</if>
					</li>
					<!--<li>
						<if condition="$st.auto_debt_status eq 1">
							<form action="{:url('uc/safe/cancel_auth')}" method="post" class="cancelAuth" data-text="您确定要取消债权授权吗？">
								<input type="hidden" name="auth_type" value="auto_debt_status" />
								<span class="fl">购买债权授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small a999">取消</i>
								<input type="submit" class="submit_btn" value="取消"/>
							</form>
							<else/>
							<form action="{:url('uc/safe/auth')}" method="post">
								<input type="hidden" name="auth_type" value="auto_debt_status" />
								<input type="hidden" name="auth_value" value="{$st.auto_debt_status}">
								<span class="fl">购买债权授权</span>
								<i class="iconfont arrow_r">&#xe611;</i>
								<i class="des fr small af60">开启</i>
								<input type="submit" class="submit_btn" value="开启"/>
							</form>
						</if>
					</li>-->
				</if>
			</ul>
		</div>
		</if>

		<div class="center_link_list">
			<ul>
				<li>
					<a href="{:url('uc/safe/password')}">
						<span>登录密码</span>
						<i class="iconfont arrow_r">&#xe611;</i>
						<i class="des fr small a999">修改</i>
						<div class="cl"></div>
					</a>
				</li>
				<if condition="$Think.session.user_auth.type eq 0">
				<li>
					<a
                    <if condition="$risk.grade_name eq ''">
                        <if condition="$deposit_status eq 1">href="{:url('uc/safe/risk')}"<else/>href="{:url('uc/index/account')}"</if><else/>href="{:url('uc/safe/risk_success')}"</if>>
						<span>风险评测</span>
						<i class="iconfont arrow_r">&#xe611;</i>
						<if condition="$risk.grade_name eq ''">
							<i class="des fr small red">立即评测</i>
							<else/>
							<i class="des fr small a999">{$risk.grade_name|default=''}</i>
						</if>
						<div class="cl"></div>
					</a>
				</li>
				</if>
			</ul>
		</div>
	</div>

	<!--邮箱设置-->
	<div id="email_set" class="openframe hide">
		<div class="mark_bar invest_mark_bar">
			<a href="javascript:;" onclick="movebot('email_set');" class="goback fl"><i class="iconfont">&#xe602;</i></a>
			<p>邮箱设置</p>
		</div>
		<div class="openframe_content cl" style="padding: 2.85rem 0 0 0;">
			<form action="{:url('uc/safe/email')}" method="post" id="emailForm">
				<div class="form">
					<div class="input_form">
						<div class="input_form_bar">
							<p class="fl">邮箱地址</p>
							<input placeholder="请输入邮箱地址" name="email" id="email" value="" type="text" required />
							<a href="javascript:void(0);" class="send_btm" id="sendVerify">获取验证码</a>
							<div class="cl"></div>
						</div>
						<div class="input_form_bar">
							<p class="fl">验证码</p>
							<input placeholder="请输入验证码" name="verify" id="emailVerify" type="text" required />
							<div class="cl"></div>
						</div>
					</div>
				</div>
				<div class="wrap">
					<button type="submit" class="submit" id="loginsubmit">立即设置</button>
				</div>
			</form>
		</div>
	</div>

	<notempty name="$cooper">
		<div id="company_info" class="openframe hide">
			<div class="mark_bar invest_mark_bar">
				<a href="javascript:;" onclick="movebot('company_info');" class="goback fl"><i class="iconfont">&#xe602;</i></a>
				<p>企业信息</p>
			</div>
			<div class="openframe_content" style="line-height: 1.6rem;">
				<table cellspacing="5px" cellpadding="5px" class="tables_block">
					<tr><td>企业名称：{$cooper.enterprise_name}</td></tr>
					<notempty name="cooper.unified_code">
						<tr><td>统一社会信用代码：{$cooper.unified_code}</td></tr>
						<else/>
						<tr><td>营业执照编码：{$cooper.business_license}</td></tr>
						<tr><td>税务登记号：{$cooper.tax_no}</td></tr>
						<tr><td>组织机构代码：{$cooper.org_no}</td></tr>
					</notempty>
					<tr><td>机构信用代码：{$cooper.credit_code}</td></tr>
					<tr><td>法人姓名：{$cooper.legal}</td></tr>
					<tr><td>法人身份证号：{$cooper.legal_idcard}</td></tr>
					<tr><td>企业联系人：{$cooper.contact}</td></tr>
					<tr><td>联系人手机号：{$cooper.contact_phone}</td></tr>
					<tr><td>开户银行许可证核准号：{$cooper.bank_license}</td></tr>
					<tr><td>企业对公账号：{$cooper.card_id}</td></tr>
					<tr><td>开户地区：///</td></tr>
				</table>
                <form action="{:url('uc/safe/update_information')}" method="post" class="pt1">
                    <input type="submit" value="修改企业信息" class="submit" />
                </form>
			</div>
		</div>
	</notempty>


</block>

<block name="menu"></block>

<block name="js">
	<script type="text/javascript" src="__JS__/check.js?v={:config('app_ver')}"></script>
	<script type="text/javascript">

        $(".cancelAuth").submit(function () {
            var _this = $(this);
            var text = $(this).attr("data-text");
            layer.open({
                content: text
                ,btn: ['确定','取消']
                ,yes: function(){
                    return ajax_post(_this);
                }
            });
            return false;
        });

        $("#sendVerify").click(function () {
            var email = $("#email").val();
            if(!checkEmail()) return false;
            $.post("{:url('uc/safe/email')}", {email: email}, function (data) {
                if(data.code == 1){
                    wjtips(data.msg);
                }else{
                    wjtips(data.msg);
                }
            }, "json")
        });

        $("#emailForm").submit(function () {
            var self = $(this);
            var verify = $(self).find("#emailVerify");
            if(!checkEmail()) return false;
            if (verify.val().length <= 0) {
                wjtips("请输入验证码!");
                return false;
            }
            return ajax_post(self);
        });
	</script>

</block>